program test_allocate
implicit none
double precision, allocatable:: vec(:)
double complex :: c
double precision:: rc

c=(2d0, 1d0)
c = cmplx(3d0,real(c))
print *, c

allocate(vec(2))
call func(vec)
write(*,*) vec
deallocate(vec)
stop
end program

subroutine func(vec)
  implicit none
  double precision, dimension(2) :: vec
  vec(1)=1d0
  vec(2)=2d0
end subroutine func


